//
//  WZGAplyToShopkeeperSecondCell.m
//  ZCJZ
//
//  Created by 潘洪波 on 2020/2/27.
//  Copyright © 2020 jeking. All rights reserved.
//

#import "WZGAplyToShopkeeperSecondCell.h"
#import <UILabel+Flex.h>
#import "TBCityIconFont.h"

@implementation WZGAplyModel



@end

@interface WZGAplyToShopkeeperSecondCell ()

@property (nonatomic, strong) UIView *bgView ;
@property (nonatomic, strong) UILabel *titleLabel ;
@property (nonatomic, strong) UILabel *contentLabel ;
@property (nonatomic, strong) UIImageView *checkImg ;
@property (nonatomic, strong) UIImageView *aplyIntroImg ;


@end


@implementation WZGAplyToShopkeeperSecondCell

- (instancetype)initWithFlex:(NSString *)flexName reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithFlex:flexName reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self.aplyIntroImg setUserInteractionEnabled:YES];
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(introImgTap)];
        [self.aplyIntroImg addGestureRecognizer:tap];

    }
    return self;
}

- (void)introImgTap{
    if (self.introClick) {
        self.introClick();
    }
}

- (void)setModel:(WZGAplyModel *)model{
    _model = model;
    if (model) {
        [self.titleLabel setFlexAttrString:model.title name:@"title"];
        [self.titleLabel updateAttributeText];
        self.contentLabel.text=  model.content;
        if (model.selected) {
            self.bgView.backgroundColor = [UIColor whiteColor];
          self.bgView.layer.borderColor = [generalToolBox getColorWithHexadecimalColorStr:@"0xF9150F"].CGColor;
            self.bgView.layer.borderWidth = 1;
            self.checkImg.image = [UIImage iconWithInfo:TBCityIconInfoMake(@"\U0000e648", 25, [generalToolBox getColorWithHexadecimalColorStr:@"0xF92924"])];
        }else{
          self.bgView.backgroundColor = [generalToolBox getColorWithHexadecimalColorStr:@"0xf7f7f7"];
            self.bgView.layer.borderColor = nil;
            self.bgView.layer.borderWidth = 0;
            self.checkImg.image = [UIImage iconWithInfo:TBCityIconInfoMake(@"\U0000e647", 25, [generalToolBox getColorWithHexadecimalColorStr:@"0x999999"])];
        }
    }
}

@end
